<?php

use think\facade\Route;

$version = request()->header('version') ?? 'v1';

Route::group('', function() use ($version) {

    /**
     * 不需验证
     */
    Route::group('', function () use ($version) {
        /*
         * 系统相关
         */
        // 信息维护
        Route::rule('info/:action', 'api.' . $version . '.site.InfoController/:action');
        Route::rule('site/:action', 'api.' . $version . '.site.SiteController/:action');

        /*
         * Callback
         */
        Route::rule('callback/alipay', 'api.CallbackController/alipay');
        Route::rule('callback/wechatpay', 'api.CallbackController/wechatpay');
        Route::rule('callback/trtcRoom', 'api.CallbackController/trtcRoom');
        Route::rule('callback/wechatConsultRefund', 'api.CallbackController/wechatConsultRefund');
    });
})->middleware([
    'cors'
]);
